<?php
namespace app\admin\controller;

use app\admin\model\Order as M;

// 后台订单类
class Order extends BaseController
{
    // 订单显示页
    public function index()
    {
        $m = new M();
        $data = $m->pageQuerys();
        $num = count($data);
        $page = $data->render();
        $this->assign('data', $data);
        $this->assign('page', $page);
        $this->assign('num', $num);
        return $this->fetch();
    }

    // 订单修改和查看
    public function edit()
    {
        $m = new M();
        if (input("post.")) {
           return $rs = $m->edit();
        } else {
            $info = $m->getById();
            $this->assign('data', $info);
            return $this->fetch('edit');
        }
    }

    // 上传照片编辑
    public function pictureEdit()
    {
        $m = new M();
       return $m->pictureEdit();

    }
    // 雇工订单信息查看
    public function getOrder()
    {
        $m = new M();
        $info = $m->getOrder('order');
        $this->assign('data', $info);
        return $this->fetch('order');

    }

    // 雇工删除
    public function del()
    {
        $m = new M();
        return $m->del();
    }

    // 雇工批量删除
    public function proBatchDel()
    {
        $m = new M();
        $query = $m->proBatchDel();
        return $query;
    }
}
